package com.wish.g04.renting.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

import com.wish.g04.common.core.web.controller.BaseController;
import com.wish.g04.common.core.web.domain.AjaxResult;
import com.wish.g04.renting.dto.MOwnerDTO;
import com.wish.g04.renting.service.ITMOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wish.g04.common.log.annotation.Log;
import com.wish.g04.common.log.enums.BusinessType;
import com.wish.g04.common.security.annotation.PreAuthorize;

/**
 * 【收房合同】Controller
 * 
 * @author ruoyi
 * @date 2022-05-28
 */
@RestController
@RequestMapping("/owner")
public class TMOwnerController extends BaseController
{
    @Autowired
    private ITMOwnerService tMOwnerService;

//    /**
//     * 获取【请填写功能名称】详细信息
//     */
//    @PreAuthorize(hasPermi = "system:owner:query")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return AjaxResult.success(tMOwnerService.selectTMOwnerById(id));
//    }

    /**
     * 收房合同录入
     */
    @PreAuthorize(hasPermi = "system:owner:add")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping("add")
    public AjaxResult add(@RequestBody MOwnerDTO mOwnerDTO)
    {
        return toAjax(tMOwnerService.insertTMOwner(mOwnerDTO));
    }

//    /**
//     * 修改【请填写功能名称】
//     */
//    @PreAuthorize(hasPermi = "system:owner:edit")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody TMOwner tMOwner)
//    {
//        return toAjax(tMOwnerService.updateTMOwner(tMOwner));
//    }
}
